import Vue from 'vue'
import Router from 'vue-router'
import login from '@/components/Index'
import statistical from '@/components/statistical/Index'
import matter from '@/components/matter/Index'

import manage from '@/components/manage/Index'
import manageList from '@/components/manage/list'
import manageAdd from '@/components/manage/add'
import manageAbout from '@/components/manage/manageAbout'

import evaluation from '@/components/evaluation/Index'
import system from '@/components/system/Index'
import user from '@/components/user/Index'
import recommend from '@/components/evaluation/recommend'
import banner from '@/components/evaluation/banner'
import hotword from '@/components/evaluation/hotword'

Vue.use(Router)
const publicPath = '/backstage'

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      redirect: publicPath + '/login'
    },
    {
      path: publicPath + '/login',
      component: login
    },
    {
      path: publicPath + '/statistical',
      component: statistical
    },
    {
      path: publicPath + '/matter',
      component: matter
    },
    {
      path: publicPath + '/manage',
      component: manage,
      children: [
        {
          path: '/',
          redirect: 'list'
        },
        {
          path: 'list',
          component: manageList
        },
        {
          path: 'add',
          component: manageAdd
        },
        {
          path: 'about',
          component: manageAbout
        }
      ]
    },
    {
      path: publicPath + '/evaluation',
      component: evaluation
    },
    {
      path: publicPath + '/recommend',
      component: recommend,
      name: 'recommend'
    },
    {
      path: publicPath + '/banner',
      component: banner,
      name: 'banner'
    },
    {
      path: publicPath + '/hotword',
      component: hotword,
      name: 'hotword'
    },
    {
      path: publicPath + '/system',
      component: system
    },
    {
      path: publicPath + '/user',
      component: user
    }
  ]
})
